package com.jdb.versailles.controller;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.jdb.versailles.model.Client;
import com.jdb.versailles.service.ClientService;
// imports..
 
@Controller
public class StockController {
   
  @Autowired 
  private ClientService clientService;
   
  @RequestMapping(value="/stock" , method = RequestMethod.GET)
  public ModelAndView homePage(HttpServletResponse response) throws IOException{
//		Client client= new Client("RAKOTOVAO","HERISOA");
//		clientService.saveClient(client);		 
//		System.out.println("MON CLIENT : "+client.getNom() +" "+client.getPrenom());
		return new ModelAndView("stock");
	}
  
  @RequestMapping(value="/sc" , method = RequestMethod.GET)
  public ModelAndView client(HttpServletResponse response) throws IOException{
//		Client client= new Client("RAKOTOVAO","HERISOA");
//		clientService.saveClient(client);		 
//		System.out.println("MON CLIENT : "+client.getNom() +" "+client.getPrenom());
		return new ModelAndView("sc");
	}
}
